require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'

class TC_Admin < Test::Unit::TestCase
  def test_07
  $ie.goto($UniVar)
  $ie.refresh()
  $ie.refresh()
  
  $ie.link(:text, 'Control Panel').click
  $ie.link(:text, 'Administration').click
  $ie.table(:index, 12).click
  $ie.link(:index, 17).click
  $ie.link(:text, 'Create new article').click
  $ie.text_field(:index, 2).value = "watir article name"
  $ie.text_field(:index, 3).value = "watir article headline"
  $ie.ie.Document.parentWindow.execScript("tinyMCE.getInstanceById(tinyMCE.getEditorId('mce_editor_0')).execCommand('mceSetContent', false, '" + $Description + "')")

    $ie.button(:id, /ctl00_bcr_ctl00_ctl04_SaveButton/).click
#  $ie.button(:id, /ctl00_ctl00_bcr_ctl00___SaveButton/).click

  $ie.link(:text, 'Control Panel').click
  $ie.link(:text, 'Administration').click
  $ie.table(:index, 12).click
  $ie.link(:index, 17).click
  $ie.link(:text, 'Edit').click

  $ie.button(:id, /ctl00_bcr_ctl00_ctl04_DeleteButton/).click
#  $ie.button(:id, /ctl00_ctl00_bcr_ctl00___DeleteButton/).click

$ie.link(:text, 'Control Panel').click
  $ie.link(:text, 'Administration').click
  $ie.table(:index, 12).click
  $ie.link(:index, 17).click
  assert(!$ie.contains_text('watir article name'))
  end
end